<?php
namespace Game\Controller;
use Common\Controller\CommonController;
class ShareController extends CommonController{

    const AppID     =   'wx0dcb83c5892f258b';
    const AppSecret =   'aab64931415e6bb57986cb832518fc98';

    /**
     * @param $game_id
     * @param $appid
     */
    public function info()
    {
        $game_id    =   I('post.game_id','','htmlspecialchars');
        $appid      =   I('post.appid','','htmlspecialchars');
        if (! empty($game_id) && ! empty($appid))
        {
            $where          =   array();
            $where['id']    =   $game_id;
            $where['appid'] =   $appid;
            $field          =   array('shareimage','sharetitle');
            $game_data      =   M('game_list')->where($where)->field($field)->find();

            if (! empty($game_data))
            {
                $data               =   array();
                $data['sharetitle'] =   $game_data['sharetitle'];
                $data['shareimage'] =   $game_data['shareimage'];
                $this->returnData($data,$msg='OK',$code=200);
            }
        }
    }
}